/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package e1h8;
import java.io.*;
/**
 *
 * @author rcerrato
 */
public class E1h8 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader( new InputStreamReader(System.in) );
        System.out.print("primera cadena: ");
        String cad1=br.readLine();
        System.out.print("segunda cadena: ");
        String cad2=br.readLine();
        int i=0;
        int f=cad2.length(),rep=0;
        do
        {
            String s=cad1.substring(i,f); 
            if(s.equals(cad2))
            {
                rep++;
                i=f;
                f=f+cad2.length();
            }
            else
            {
                f=f+1;
                i=i+1;
            } 
        }
        while(f<=cad1.length());
        
        cad1=cad1.replaceAll(cad2, cad2.toUpperCase());
        System.out.println(rep);
        System.out.println(cad1);
    }
}
